﻿using System.Collections.Generic;
using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core.Notification.Filters.Request;
using Wolfpack.Core;

namespace Wolfpack.Contrib.Checks.Powershell
{
    public class RunPowershellScriptConfigurationDiscovery : HealthCheckDiscoveryBase<RunPowershellScriptConfig, RunPowershellScript>
    {
        protected override RunPowershellScriptConfig GetConfiguration()
        {
            return new RunPowershellScriptConfig
                       {
                           Enabled = true,
                           FriendlyId = "RunPowershellScript",
                           NotificationMode = StateChangeNagFailNotificationFilter.FilterName,
                           Parameters = new Dictionary<string, string> { { "Add Parameters", "Here!" } },
                           Script = @".\Powershell\WolfpackDemo1.ps1",
                           SnapIns = new List<string> { "Add snap-ins here or leave blank" }
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "RunPowershellScript";
            entry.Description = "This check will execute a powershell script; it can optionally return " + 
                "Health Check result data back to Wolfpack and it will be broadcast to all active publishers just like a regular check would.";
            entry.Tags.AddIfMissing("Powershell");
        }
    }
}